package com.fxd.feigns.fallback;

import com.fxd.core.util.RR;
import com.fxd.feigns.CouponFeign;
import com.fxd.model.coupon.SpuBoundsEntity;
import com.fxd.common.param.SkuReductionParam;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CouponFallbackFactory implements FallbackFactory<CouponFeign> {
    @Override
    public CouponFeign create(Throwable throwable) {
        return new CouponFeign() {
            @Override
            public RR saveSpuBounds(SpuBoundsEntity spuBounds) {
                return  RR.error(500,"连接超时");
            }

            @Override
            public RR saveReduction(SkuReductionParam skuReductionParam) {
                return RR.error(500,"连接超时");
            }
        };
    }
}
